﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using Utility;
using System.Data.SqlClient;
using System.Data;

public partial class StrategicPlan_DisplayslogansImg : System.Web.UI.Page
{
    public string imgs = string.Empty;
    string SQL_queryIntroduction = "SELECT * FROM [DS_IntroductionImg] WHERE DepartmentId=@DepartmentId ORDER BY OrderValue";
    string SQL_queryManagementSlogans = "SELECT * FROM [DS_ManagementSlogans] WHERE DepartmentId=@DepartmentId ORDER BY OrderValue";
    string SQL_queryCoreevents = "SELECT * FROM [DS_CoreeventsImg] WHERE DepartmentId=@DepartmentId ORDER BY OrderValue";
    string SQL_queryManagementObject = "SELECT * FROM [DS_ManagementObject] WHERE DepartmentId=@DepartmentId ORDER BY OrderValue";
    protected void Page_Load(object sender, EventArgs e)
    {
        int DepartmentId = HttpHelp.getParamsInt("departmentid");
        SqlParameter[] parameters = new SqlParameter[1];
        parameters[0] = new SqlParameter("@DepartmentId", DepartmentId);
        int typeid = HttpHelp.getParamsInt("type");
        DataTable dt = new DataTable();
        switch (typeid)
        {
            case 1:
                dt = SqlHelper.ExecuteDataset(SqlHelper.connStr,
 CommandType.Text, SQL_queryIntroduction, parameters).Tables[0];
                break;
            case 2:
                dt = SqlHelper.ExecuteDataset(SqlHelper.connStr,
CommandType.Text, SQL_queryCoreevents, parameters).Tables[0];
                break;
            case 3:
                dt = SqlHelper.ExecuteDataset(SqlHelper.connStr,
 CommandType.Text, SQL_queryManagementObject, parameters).Tables[0];
                break;
            case 4:
                dt = SqlHelper.ExecuteDataset(SqlHelper.connStr,
CommandType.Text, SQL_queryManagementSlogans, parameters).Tables[0];
                break;
        }

        foreach (DataRow dr in dt.Rows)
        {
            imgs += "<li> <img   src=\"" + dr["imgurl"] + "\"> </li>";

        }


    }
}